package cn.epsilon3.domain.e3.dto.add;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @description 新增资源入参
 *
 * @author: epsilon3
 * @date: 2023/11/11 17:16
 */
@Data
public class E3ResourceAdd implements Serializable {

    private static final long serialVersionUID = -7056827334214316913L;

    /**
     * 资源名称
     */
    @NotBlank(message = "资源名称不能为空")
    @ApiModelProperty(value = "资源名称",required = true)
    private String resourceName;

    /**
     * 资源权限标识符，只对功能有效
     */
    @ApiModelProperty(value = "资源权限标识符，只对功能有效")
    private String resourcePerms;

    /**
     * 上级资源id，type为C时上级必须为0或C，type为R时必须为0或C，type为F时上级必须为R
     */
    @NotBlank(message = "上级资源ID不能为空")
    @ApiModelProperty(value = "上级资源id，type为C时上级必须为0或C，type为R时必须为0或C，type为F时上级必须为R",required = true)
    private String parentId;

    /**
     * 资源层级，每个type层级分离
     */
    @Min(value = 1,message = "最小层级为1")
    @Max(value = 999,message = "最大层级为999")
    @NotNull(message = "资源层级不能为空")
    @ApiModelProperty(value = "资源层级，每个type层级分离",required = true)
    private Integer resourceLevel;

    /**
     * 资源路径，只对路由有效
     */
    @ApiModelProperty(value = "资源路径，只对路由有效")
    private String resourcePath;

    /**
     * 资源参数，只对路由有效
     */
    @ApiModelProperty(value = "资源参数，只对路由有效")
    private String resourceParams;

    /**
     * 资源类型，C为目录 R为菜单 F为功能
     */
    @NotBlank(message = "资源类型不能为空")
    @ApiModelProperty(value = "资源类型，C为目录 R为菜单 F为功能",required = true)
    private String resourceType;

    /**
     * 资源图标
     */
    @ApiModelProperty(value = "资源图标")
    private String resourceIcon;

}
